package Demo06.Demo010;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

public class Demo010_test {
    public static void main(String[] args) {
            String str = "Hello World";
        ByteArrayInputStream bis = new ByteArrayInputStream(str.getBytes());
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        int len = - 1;
        while ((len=bis.read())!=-1){
            System.out.print(""+(char)len);
            if (len>=97&&len<=122){
                len-=32;
            }
            bos.write(len);
        }
        String string = bos.toString();
        System.out.println(string);
    }
}
